﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using System.Threading;

using Hangjing.SQLServerDAL;
using Hangjing.Common;
using Hangjing.Model;
using System.ComponentModel;

/// <summary>
/// 注：页面中<%@ Page 要加 Async="true"
/// </summary>
public partial class Admin_buildAddressData : System.Web.UI.Page
{
    shopexpressFeeConfig dal = new shopexpressFeeConfig();

    BackgroundWorker bgw;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {

        }
    }

    protected void test_Click(object sender, EventArgs e)
    {
        bgw = new BackgroundWorker();
        bgw.WorkerSupportsCancellation = true;
        bgw.WorkerReportsProgress = true;

        bgw.DoWork += new DoWorkEventHandler(DoWork);
        //bgw.ProgressChanged += new ProgressChangedEventHandler(bgw_ProgressChanged);
        bgw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgw_RunWorkerCompleted);

        bgw.RunWorkerAsync();

    }

    /// <summary>
    /// 耗时操作
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    void DoWork(object sender, DoWorkEventArgs e)
    {

        dal.InitData();


    }

    /// <summary>
    /// 完成
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    void bgw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    {
        AlertScript.RegScript(this.Page, UpdatePanel1, "alert('执行完成');hideload_super();");
    }
}
